find_package(Lua51 REQUIRED)

set(DIR ${CMAKE_CURRENT_SOURCE_DIR}/components)
aux_source_directory(${DIR}/lua_script LUA_SCRIPT_SRC)

add_library(Component::LuaScript INTERFACE IMPORTED)

target_include_directories(Component::LuaScript INTERFACE
                           ${DIR} ${LUA_INCLUDE_DIR})

set_target_properties(
    Component::LuaScript
    PROPERTIES
    INTERFACE_LINK_LIBRARIES ${LUA_LIBRARIES}
    INTERFACE_SOURCES ${LUA_SCRIPT_SRC}
)
